1) Field of the Invention
The present invention relates to a technology for encoding and compressing moving-image data on a real time basis, in conformity with the moving picture experts group (MPEG) standard.
2) Description of the Related Art
In the MPEG-2 standard applied products, it is necessary to store image data within a certain bit rate, while encoding the image data on a real time basis. In the encoding processing of a two-path system in which image data is encoded beforehand, and actual encoding is performed after observing the change in the amount of information generated, allocation of the bit rate can be performed accurately. However, the two-path system is not suitable when it is necessary to perform encoding on a real time bases, such as a movie camera.
Generally, the encoding at the time of encoding on a real time bases is performed in the following manner. That is, encoding of a first picture is performed by predicting the amount of information generated to some extent at the time of starting encoding (at the time of starting video recording). Based on the information amount generated as a result thereof, the allocated information amount for a second picture is adjusted and the second picture is encoded. For a third picture, based on the information amount generated by encoding of the first and the second pictures, the allocated information amount therefor is adjusted and the third picture is encoded. Thus, while performing feedback control based on the amount of information generated of pictures encoded previously, the relation between the input image and the amount of information generated is gradually learned, so that appropriate allocation of information amount can be obtained.
As an information amount conversion circuit for changing the bit rate of a bit stream including main data, whose data length changes according to the bit rate, such as a bit stream encoded in conformity with the MPEG-2 Standard, a circuit has been proposed, which has a unit that cuts out the main data from the bit stream, a unit that converts the cut main data according to a target bit rate and outputs the converted main data, and a unit that inserts the converted main data into the bit stream, instead of the main data before the conversion (see, for example, Japanese Patent Application Laid-open No. H7-312756). The invention disclosed in this literature increases the compressibility by re-encoding the bit stream encoded according to the MPEG Standard, and is different from the present invention.
Further, as a variable bit rate encoding method, a method has been proposed, which includes: an analysis step of encoding an image sequence by using a predetermined quantization step size and generating a bit stream that does not satisfy the restriction of a specific step size in which an average bit rate in this sequence is required; a prediction step of predicting the quantization step size used for encoding the bit stream based on a predetermined target bit rate; a step of obtaining more accurate evaluation for the step size by repeating at least once the analysis step and the prediction step; and a final control step of comparing the cumulative bit rate for all previous frames with the predicted cumulative bit rate to adjust the step size so that the cumulative bit rate matches with the target bit rate (see, for example, Japanese Patent Application Laid-open No. 2001-501429). The invention disclosed in this literature repeats the analysis step and the prediction step several times to generate a bit stream, which is different from the present invention.
In the conventional method in which the relation between the input image and the amount of information generated is gradually learned, while performing the feedback control, several to several tens pictures are required from the start of encoding until a stable state can be obtained. In other words, for a while after having started encoding, learning of allocation of the amount of information generated has not been done. Therefore, from starting video recording until a stable state can be obtained, there are problems in that the image quality is poor, and too much bit rate may be allocated to the required image quality, thereby using the information amount uselessly. Further, there is no solution as to how the encoding parameter can be set in order to generate the information amount close to the target information amount.
There is a method of starting encoding earlier than the original video recording starting time to perform learning, and recording a bit stream on a recording medium since learning has finished and the stable state has been obtained. With this method, however, since it is necessary to activate the encoding unit before starting the actual video recording, power consumption is increased uselessly. Therefore, when it is desired to reduce the power consumption, this method is not suitable, for example, to a movie camera driven by battery.